#!/bin/bash

env | grep USER | grep root >/dev/null

if [[ $? -eq 0 ]]; then
    echo "you have the right permission"
else
    echo "sorry, you should be the root to excute this scrips"
    exit 1
fi

if [[ $# -eq 1 ]]; then
    echo "you will add a new user"
else
    echo "Usage: bash do_env.sh newuser"
    exit 1
fi

cat /etc/passwd | grep $1 >/dev/null 

if [[ $? -eq 0 ]]; then
    echo "the user have been existed"
    exit 1
else    
    adduser $1
fi

echo "ClientAliveInterval 60" >> /etc/ssh/sshd_config
echo "ClientAliveCountMax 3" >> /etc/ssh/sshd_config
service sshd restart

echo "i will start making configuration of vim"

sleep  10

echo "i have finish the work of vim configuration"

echo "i will start making configuration of zsh"

sleep  10

echo "i have finish the work of zsh configuration"



